#ifndef _COLLISION_BOX_H_
#define _COLLISION_BOX_H_

#include <graphics.h>
#include "util.h"

extern bool is_debug;

class Collision_box
{

public:
	Collision_box() = default;
	~Collision_box() = default;

	
	Collision_box(POINT p1, POINT p2)
	{
		start = p1;
		end = p2;
	}

	void setbox(int x1, int y1, int x2, int y2) {
		start.x = x1;
		start.y = y1;
		end.x = x2;
		end.y = y2;
	}

	void setbox(POINT p1, POINT p2)
	{
		start = p1;
		end = p2;
	}

	void reset()
	{
		start = { 0 };
		end = { 0 };
	}

	POINT get_start()
	{
		return start;
	}

	POINT get_end()
	{
		return end;
	}

	void on_draw(const Camera& camera) const
	{
		if (is_debug)
		{
			setlinecolor(RGB(255, 0, 0));
			line(camera, start.x, start.y, start.x, end.y);
			line(camera, start.x, start.y, end.x, start.y);
			line(camera, start.x, end.y, end.x, end.y);
			line(camera, end.x, start.y, end.x, end.y);
		}

		
	}



private:
	POINT start = { 0 };
	POINT end = { 0 };
};




#endif // !_COLLISION_BOX_H_
